package castleContent;
public class ResourceBuilding extends Building{
	
	private static final int DEFAULT_AVAILABLE_RESOURCE = 5000;
	private static final int RESOURCE_NEED_FOR_UPGRADE = 500;
	private static final int DEFAULT_PRODUCTION = 200;
	private static final int BONUS_PRODUCTION_PER_LEVEL = 200;
	private int production;
	private int availableResource;

	ResourceBuilding() {
		production = DEFAULT_PRODUCTION;
		setAvailableResource(DEFAULT_AVAILABLE_RESOURCE);
	}
	
	ResourceBuilding(int availableResource, int production) {
		this.production = production;
		setAvailableResource(availableResource);
	}
	
	@Override
	public void levelUp() {
		super.levelUp();
		addProduction();
		availableResource -= RESOURCE_NEED_FOR_UPGRADE;
	}

	public void setAvailableResource(int resource) {
		availableResource = resource;
	}
	
	public int getAvailableResource() {
		return availableResource;
	}
	
	public int getProduction() {
		return this.production;
	}
	public void getBuildingLevel(){
		
	}
	private void addProduction() {
			this.production += BONUS_PRODUCTION_PER_LEVEL;
	}
}
